package com.hjl.spring6.bean.iocXml.scope;

import com.hjl.spring6.bean.iocXml.scope.User;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author ServivE
 * @version 0.1
 * @className com.hjl.spring6.bean.iocXml.scope.TestScope
 * @description
 * @date 2024/8/6 16:32
 * @since jdk11
 */
public class TestScope {
    @Test
    public void testScope() {
        ApplicationContext ac = new ClassPathXmlApplicationContext("bean-scope.xml");
        User user1 = ac.getBean("user", User.class);
        User user2 = ac.getBean("user", User.class);
        System.out.println(user1 == user2);
    }
}
